import { request } from '@/framework/utils/request-jdz';

export const deviceQuery = (params) => {
  return request(
    {
      url: '/device/page',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};

export const deviceDetail = (id) => {
  return request(
    {
      url: `/device/${id}`,
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
};

// 添加设备
export const deviceAdd = (params) => {
  return request(
    {
      url: '/device/',
      method: 'post',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};

// 更新设备
export const deviceUpdate = (params) => {
  return request(
    {
      url: `/device/${params.id}`,
      method: 'put',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
